package GUILayer;

import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.Point;

import javax.swing.JFrame;
import javax.swing.JMenuBar;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.border.TitledBorder;
import javax.swing.JComboBox;
import javax.swing.JList;
import javax.swing.JLabel;
import javax.swing.JButton;
import javax.swing.JTextField;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import ControlLayer.*;
import ModelLayer.SaleOrder;

import javax.swing.DropMode;
import javax.swing.JSpinner;
import java.awt.List;
import java.util.ArrayList;
public class SaleOrderGUI extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JPanel contentPane;
	private SaleOrderCtr soc;
	private JLabel sogLblShowOrderId1;
	private JLabel sogLblShowOrderId2;
	private JLabel sogLblShowOrderId3;
	private JLabel sogLblShowOrderId4;
	private JLabel sogLblShowOrderId5;
	private JLabel sogLblShowOrderId6;
	private JLabel sogLblShowOrderId7;
	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					SaleOrderGUI frame = new SaleOrderGUI();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public SaleOrderGUI() {
		
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 855, 530);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		
		

		
		JButton sogBtnShowId = new JButton("Vis Ordre");
		sogBtnShowId.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				SaleOrderCtr soc = SaleOrderCtr.getInstance();
				int saleOrderId = 1;
				
			sogLblShowOrderId1.setText(""+soc.findSaleOrderId(saleOrderId).getCustomerId()+"");
			sogLblShowOrderId2.setText(""+soc.findSaleOrderId(saleOrderId).getDato()+"");
			sogLblShowOrderId3.setText(""+soc.findSaleOrderId(saleOrderId).getDeliveryDate()+"");
			sogLblShowOrderId4.setText(""+soc.findSaleOrderId(saleOrderId).getDeliveryStatus()+"");
			sogLblShowOrderId5.setText(""+soc.findSaleOrderId(saleOrderId).getInVoiceNo()+"");
			sogLblShowOrderId6.setText(""+soc.findSaleOrderId(saleOrderId).getSaleOrderItemId()+"");
			sogLblShowOrderId7.setText(""+soc.findSaleOrderId(saleOrderId).getTotalPrice()+"");
			
			
				
		}
		}
		);
		sogBtnShowId.setBounds(10, 140, 89, 23);
		contentPane.add(sogBtnShowId);
		
		sogLblShowOrderId1 = new JLabel("Customer ID");
		this.sogLblShowOrderId1.setBounds(122, 144, 71, 14);
		contentPane.add(sogLblShowOrderId1);		
		
		sogLblShowOrderId2 = new JLabel("Dato");
		this.sogLblShowOrderId2.setBounds(122, 169, 71, 14);
		contentPane.add(sogLblShowOrderId2);
		
		sogLblShowOrderId3 = new JLabel("DeliveryDate");
		this.sogLblShowOrderId3.setBounds(122, 201, 71, 14);
		contentPane.add(sogLblShowOrderId3);
		
		sogLblShowOrderId4 = new JLabel("DeliveryStatus");
		this.sogLblShowOrderId4.setBounds(122, 233, 71, 14);
		contentPane.add(sogLblShowOrderId4);
		
		sogLblShowOrderId5 = new JLabel("InVoiceNo");
		this.sogLblShowOrderId5.setBounds(122, 263, 71, 14);
		contentPane.add(sogLblShowOrderId5);
		
		sogLblShowOrderId6 = new JLabel("SaleOrderId");
		this.sogLblShowOrderId6.setBounds(122, 298, 71, 14);
		contentPane.add(sogLblShowOrderId6);
		
		sogLblShowOrderId7 = new JLabel("TotalPrice");
		this.sogLblShowOrderId7.setBounds(122, 323, 71, 14);
		contentPane.add(sogLblShowOrderId7);
		
		JButton btnSletOrdre = new JButton("Slet Ordre");
		btnSletOrdre.setBounds(270, 140, 89, 23);
		contentPane.add(btnSletOrdre);
		
		
		}
}
